package com.peng.ivos.audit.controller;

import com.peng.ivos.audit.pojo.dto.AuditQuery;
import com.peng.ivos.audit.pojo.dto.AuditSaveParam;
import com.peng.ivos.audit.service.AuditService;
import com.peng.ivos.base.response.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 审批单控制器
 * @author： Peng
 * @date： 2024/5/24
 * @version: 1.0
 */
@RestController
@RequestMapping("/v1/audit")
@Slf4j
public class AuditController {
    @Autowired
    private AuditService auditService;

    @GetMapping("/select")
    public JsonResult SelectAudit(AuditQuery auditQuery) {
        log.debug("查询审批，auditQuery: {}", auditQuery);
        return  auditService.selectAudit(auditQuery);
    }

    @PostMapping("/update")
    public JsonResult updateAudit(AuditSaveParam auditSaveParam) {
        log.debug("更新审批，auditSaveParam: {}", auditSaveParam);
        return auditService.updateAudit(auditSaveParam);
    }
}
